/*
 * Summary.java
 *
 * Created on April 12, 2006, 9:26 PM
 */

/**
 *
 * @author  Sujal Bista
 */
public class Summary extends javax.swing.JDialog {
    
    /** Creates new form Summary */
    public Summary(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        mistakeT = new javax.swing.JTextArea();
        mistakeL = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        panel1 = new java.awt.Panel();
        TitleL = new java.awt.Label();
        jPanel1 = new javax.swing.JPanel();
        nameL = new javax.swing.JLabel();
        eventL = new javax.swing.JLabel();
        finalScoreL = new javax.swing.JLabel();
        groupGenderL = new javax.swing.JLabel();
        deductionL = new javax.swing.JLabel();
        scoreCL = new javax.swing.JLabel();
        scoreAL = new javax.swing.JLabel();
        scoreBL = new javax.swing.JLabel();
        rankingL = new javax.swing.JLabel();

        mistakeT.setEditable(false);
        mistakeT.setFont(new java.awt.Font("Courier", 1, 24)); // NOI18N
        mistakeT.setLineWrap(true);
        mistakeT.setWrapStyleWord(true);
        mistakeT.setBorder(null);
        jScrollPane1.setViewportView(mistakeT);

        mistakeL.setFont(new java.awt.Font("Bitstream Vera Serif", 0, 36)); // NOI18N
        mistakeL.setText("mistake");
        mistakeL.setMaximumSize(new java.awt.Dimension(800, 47));

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(1024, 768));

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setMinimumSize(new java.awt.Dimension(800, 600));
        jPanel2.setPreferredSize(new java.awt.Dimension(800, 600));

        TitleL.setAlignment(java.awt.Label.CENTER);
        TitleL.setFont(new java.awt.Font("Arial Rounded MT Bold", 1, 50)); // NOI18N
        TitleL.setForeground(new java.awt.Color(255, 102, 153));
        TitleL.setText("Wushu Tournament");
        panel1.add(TitleL);
        TitleL.getAccessibleContext().setAccessibleName("Title");

        jPanel2.add(panel1);

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setMinimumSize(new java.awt.Dimension(780, 580));
        jPanel1.setPreferredSize(new java.awt.Dimension(1024, 600));
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        nameL.setFont(new java.awt.Font("Bitstream Vera Sans", 0, 80)); // NOI18N
        nameL.setForeground(new java.awt.Color(51, 51, 255));
        nameL.setText("Name");
        jPanel1.add(nameL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 90, 950, 100));

        eventL.setFont(new java.awt.Font("Copperplate Gothic Bold", 0, 36)); // NOI18N
        eventL.setText("event");
        jPanel1.add(eventL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 40, -1, -1));

        finalScoreL.setFont(new java.awt.Font("Verdana", 0, 100)); // NOI18N
        finalScoreL.setForeground(new java.awt.Color(0, 0, 204));
        finalScoreL.setText("Final Score : 0.0");
        jPanel1.add(finalScoreL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 410, 930, 170));

        groupGenderL.setFont(new java.awt.Font("Copperplate Gothic Bold", 0, 36)); // NOI18N
        groupGenderL.setText("event");
        jPanel1.add(groupGenderL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 0, -1, -1));

        deductionL.setFont(new java.awt.Font("Bitstream Vera Serif", 0, 36)); // NOI18N
        deductionL.setText("Other : -0.0");
        jPanel1.add(deductionL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 360, 520, -1));

        scoreCL.setFont(new java.awt.Font("Bitstream Vera Serif", 0, 36)); // NOI18N
        scoreCL.setText("Judge C Score : 0.0");
        jPanel1.add(scoreCL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 310, -1, -1));

        scoreAL.setFont(new java.awt.Font("Bitstream Vera Serif", 0, 36)); // NOI18N
        scoreAL.setText("Judge A Score : 0.0");
        jPanel1.add(scoreAL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 210, -1, -1));

        scoreBL.setFont(new java.awt.Font("Bitstream Vera Serif", 0, 36)); // NOI18N
        scoreBL.setText("Judge B Score : 0.0");
        jPanel1.add(scoreBL, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 260, -1, -1));

        rankingL.setFont(new java.awt.Font("Verdana", 0, 60)); // NOI18N
        rankingL.setForeground(new java.awt.Color(0, 0, 204));
        rankingL.setText("Ranking : 1");
        jPanel1.add(rankingL, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 220, 430, 100));

        jPanel2.add(jPanel1);

        getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Summary(new javax.swing.JFrame(), true).setVisible(true);
            }
        });
    }
     
    // clear text
    public void clear()
    {
        groupGenderL.setText("");
        eventL.setText("");
        nameL.setText("");
        mistakeL.setText("");
        scoreAL.setText("");
        scoreBL.setText("");
        scoreCL.setText("");
        deductionL.setText("");
        finalScoreL.setText("");
        rankingL.setText("");
        mistakeT.setText("");
        
//        //for now do not show the content entered by Judges
//        scoreAL.setVisible(false);
//        scoreBL.setVisible(false);
//        scoreCL.setVisible(false);
//        deductionL.setVisible(false);
        mistakeT.setVisible(false);
        mistakeL.setVisible(false);
        
        
    }
    
    // set group and gender
    public void setTitle(String data)
    {
        TitleL.setText(data);
    }
    
    
    // set group and gender
    public void setGroupGender(String data)
    {
        groupGenderL.setText(data);
    }
    
    //set events
    public void setRank(String data)
    {
        rankingL.setText("Ranking : "+data);
    }
    
    //set events
    public void setEvent(String data)
    {
        eventL.setText(data);        
    }
    
    //set name
    public void setName(String data)
    {
        nameL.setText(data);
    }
    
    //set mistakes
    public void setMistake(String data)
    {
        //bad hack to show scores from al judges
        if(globalData.scoringSystem==0) // 0 Traditional System
        {
            mistakeL.setText("Scores");
            mistakeT.setText(data);
        }
        else if(globalData.scoringSystem==1) // 1 New Traditional System
        {
            mistakeL.setText("Scores");
            mistakeT.setText(data);
        }
        else // 2 Nandu System
        {
            mistakeL.setText("Summary");
            mistakeT.setText(data);
        }
    }
    
    //set Score
    public void setScoreA(String data)
    {
        if(globalData.scoringSystem==1)
            scoreAL.setText("Judge A Score : "+data+"/5.00");
        else
            scoreAL.setText("Judge A Score : "+data+"/5.00");
    }
    
    //set Score
    public void setScoreB(String data)
    {
        if(globalData.scoringSystem==0) // 0 Traditional System
            scoreBL.setText("Avg. Score : "+data+"/10.00");
        else  if(globalData.scoringSystem==1) // 1 New Traditional System
            scoreBL.setText("Judge B Score : "+data+"/5.00");        
        else // 2 Nandu System
            scoreBL.setText("Judge B Score : "+data+"/3.00");
    }
    
    public void setScoreC(String data)
    {
        scoreCL.setText("Judge C Score : "+data+"/2.00");
    }
    
    //set deduction
    public void setDeduction(String data, String reason)
    {
        String reasonString = "";
        if (reason != null && reason.length() > 0 && !reason.equals("null")) {
            reasonString = "(" + reason + ")";
        }
        deductionL.setText("Other : -"+data + " " + reasonString);;        
    }
    
    //set total
    public void setFinalScore(String data)
    {
        finalScoreL.setText("Final Score : "+data);
    }
    
    
 
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private java.awt.Label TitleL;
    private javax.swing.JLabel deductionL;
    private javax.swing.JLabel eventL;
    private javax.swing.JLabel finalScoreL;
    private javax.swing.JLabel groupGenderL;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel mistakeL;
    private javax.swing.JTextArea mistakeT;
    private javax.swing.JLabel nameL;
    private java.awt.Panel panel1;
    private javax.swing.JLabel rankingL;
    private javax.swing.JLabel scoreAL;
    private javax.swing.JLabel scoreBL;
    private javax.swing.JLabel scoreCL;
    // End of variables declaration//GEN-END:variables
    
}
